<template>
  <div>
    <CodeCard v-bind="btnDesc">
      <sdn-tag>标签一</sdn-tag>
      <sdn-tag type="success">标签二</sdn-tag>
      <sdn-tag type="info">标签三</sdn-tag>
      <sdn-tag type="warning">标签四</sdn-tag>
      <sdn-tag type="danger">标签五</sdn-tag>
      <template #annotation></template>
    </CodeCard>
  </div>
</template>

<script>


export default {
  components: {
    
  },
  methods: {
    format(percentage) {
      return percentage === 100 ? '满' : `${percentage}%`;
    }
  },
  setup() {
    const btnDesc = {
      title: "基础用法",
      describe: "基础的按钮用法。",
      codeBlock: `<sdn-tag>标签一</sdn-tag>
      <sdn-tag type="success">标签二</sdn-tag>
      <sdn-tag type="info">标签三</sdn-tag>
      <sdn-tag type="warning">标签四</sdn-tag>
      <sdn-tag type="danger">标签五</sdn-tag>`,
      attrs: [
        {
          "name": "type",
          "describe": "类型",
          "type": "string",
          "emun": "success/info/warning/danger",
          "default": "—"
        }, {
          "name": "closable",
          "describe": "是否可关闭",
          "type": "boolean",
          "emun": "—",
          "default": "FALSE"
        }, {
          "name": "disable-transitions",
          "describe": "是否禁用渐变动画",
          "type": "boolean",
          "emun": "—",
          "default": "FALSE"
        }, {"name": "hit", "describe": "是否有边框描边", "type": "boolean", "emun": "—", "default": "FALSE"}, {
          "name": "color",
          "describe": "背景色",
          "type": "string",
          "emun": "—",
          "default": "—"
        }, {
          "name": "size",
          "describe": "尺寸",
          "type": "string",
          "emun": "medium / small / mini",
          "default": "—"
        }, {"name": "effect", "describe": "主题", "type": "string", "emun": "dark / light / plain", "default": "light"}],
      events: [
        {"name": "click", "describe": "点击 Tag 时触发的事件", "params": "—"}, {
          "name": "close",
          "describe": "关闭 Tag 时触发的事件",
          "params": "—"
        }]
    };
    return {
      btnDesc,
    };
  },
};
</script>

<style scoped>
.demo {
  margin-bottom: 0.1rem;
  max-width: 50%;
}
</style>
